package com.project.web.business.controller.app;


import com.project.common.core.utils.exception.CustomException;
import com.project.common.core.utils.exception.RESP_CODE_ENUM;
import com.project.common.core.utils.exception.Result;
import com.project.common.core.utils.redis.RedisClient;

import com.project.web.business.controller.common.BaseController;
import com.project.web.business.service.app.BusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * 控制器编码范例
 *
 * @author abc
 * @date 2019-08-20 19:57
 */
@Api(tags = "编码范例")
@ApiIgnore
@RestController("businessDemoController")
@RequestMapping("/business/auth/demo")
public class DemoController extends BaseController {


    @Resource
    BusinessService service;


    @Value("${jgtl.abc}")
    private String key;


    /**
     * 测试接口
     *
     * @param test 测试参数
     * @return
     */
    @ApiOperation(value = "测试接口")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "test", value = "测试参数", dataType = "String", required = true)
    })
    @GetMapping(value = "/test")
    public Result<String> test(String test) {
        Map<String, Object> info = service.getInfo();
        info.put("yml-k",key);
        return getResult( info );
    }




}
